package com.icesoft.system.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.icesoft.framework.core.annotation.Entity;
import com.icesoft.framework.core.data.access.DataAccessCheckpoint;
import com.icesoft.framework.core.entity.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * 角色
 *
 * @author ${author}
 * @date 230326
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_role")
@Entity(module = "system", describe = "角色")
public class Role extends BaseEntity {

	@TableField
	@Column(value = "name", comment = "名称", type = MySqlTypeConstant.VARCHAR)
	private String name;

	@TableField
	@Column(value = "code", comment = "code", type = MySqlTypeConstant.VARCHAR)
	private String code;

	@DataAccessCheckpoint()
	@TableField(fill = FieldFill.INSERT)
	@Column(value = "org_id", comment = "组织机构", length = 40, type = MySqlTypeConstant.BIGINT)
	private Long orgId;

	@TableField
	@Column(value = "role_type", comment = "角色类型", type = MySqlTypeConstant.VARCHAR)
	private String roleType;

	@TableField(exist = false)
	private List<Long> menuIdList;

	@DataAccessCheckpoint()
	@TableField(fill = FieldFill.INSERT)
	@Column(value = "company_id", comment = "公司", length = 40, type = MySqlTypeConstant.BIGINT)
	private Long companyId;

}
